Robert Clay Prim (born 1921 in Sweetwater, Texas) is an American mathematician and computer scientist.
In 1941, Prim received his B.S. in Electrical Engineering from Princeton University. Later in 1949, he received his Ph.D. in Mathematics there also. Robert Prim worked at Princeton University from 1948 until 1949 as a research associate.
During the climax of World War II (1941–1944), Prim worked as an engineer for General Electric. From 1944 until 1949, he was hired by the United States Naval Ordnance Lab as an engineer and later a mathematician. At Bell Laboratories, he served as director of mathematics research from 1958 to 1961. There, Prim developed Prim's algorithm. After Bell Laboratories, Prim became vice president of research at Sandia National Laboratories.
During his career at Bell Laboratories, Robert Prim along with coworker Joseph Kruskal developed two different algorithms (see greedy algorithm) for finding a minimum spanning tree in a weighted graph, a basic stumbling block in computer network design. His self named algorithm, Prim's algorithm, was originally discovered in 1930 by mathematician Vojtěch Jarník and later independently by Prim in 1957. It was later rediscovered by Edsger Dijkstra in 1959. It is sometimes referred to as the DJP algorithm or the Jarník algorithm.